package com.mq.transaction;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author ytj
 * @date 2024/1/23
 */
@Component
@RabbitListener(queues = Demo12Message.QUEUE_NAME)
public class Demo12Consumer {

    @RabbitHandler
    public void message(Demo12Message demo12Message){
        System.out.println("线程编码:"+Thread.currentThread().getId()+"获取消息:"+demo12Message.getId());
    }
}
